<?php
session_start();
include_once('../../admin/php/bootstrap.php');
$cuit = preg_replace('/(\.|-)/', '', $_POST['cuit']);
//$cuit = $_POST['cuit'];
if (strlen($cuit) > 3 && Doctrine::getTable('cliente')->findOneByCuit($cuit)) {
    $_SESSION['cuit'] = $cuit;
    header('location: '.$_SERVER['HTTP_REFERER'].'#success');
} else {
    session_destroy();
    header('location: '.$_SERVER['HTTP_REFERER'].'#error');
}
?>
